<header id="main_header">
	<form id="switch_language" action="org/kahikai/action/switch_language.php" method="post">
		<input name="language" type="submit" value="EN"></input>
		<input name="language" type="submit" value="FR"></input>
		<input name="language" type="submit" value="DE"></input>
	</form>
<?php
	if(!isset($_SESSION['isAuthenticated']) || $_SESSION['isAuthenticated'] == false) {
		$login_form_text = getLocalizedText('login_form');
		echo "\t<form id=\"login\" action=\"org/kahikai/action/login.php\" method=\"post\">\n";
		echo "\t\t<label for=\"kahikai_user\">" . $login_form_text['user'] . ": </label>\n";
		echo "\t\t<input name=\"kahikai_user\" type=\"email\" id=\"kahikai_user\" placeholder=\"user@kahikai.org\"";
		if(isset($_SESSION['userEmail'])) {
			echo 'value="' . $_SESSION['user']->email . '"';
		}
		echo "></input>\n";
		echo "\t\t<label for=\"kahikai_password\">" . $login_form_text['password'] . ": </label>\n";
		echo "\t\t<input name=\"kahikai_password\" type=\"password\" id=\"kahikai_password\"></input>\n";
		echo "\t\t<input type=\"submit\" value=\"login\"></input>\n";
		echo "\t</form>\n";
		if(isset($_SESSION['isAuthenticated']) && $_SESSION['isAuthenticated'] == false) {
			echo "\t<a href=\"password_reset.php\">" . $login_form_text['rest_password'] . "</a>\n";
		}
		echo "\t<a href=\"create_account.php\">" . $login_form_text['create_account'] . "</a>\n";
	} else {
		echo "\t<form id=\"logout\" action=\"org/kahikai/action/logout.php\" method=\"post\">\n";
		echo "\t\t<label for=\"logout\">" . $_SESSION['user']->email . "</label>\n";
		echo "\t\t<input type=\"submit\" value=\"logout\" id=\"logout\"></input>\n";
		echo "\t</form>\n";
	}
?>
</header>
